package org.stvd.entities.workflow;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import org.stvd.entities.base.BaseEntity;
import org.stvd.entities.common.LongJsonDeserializer;
import org.stvd.entities.common.LongJsonSerializer;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * @Title WfGroup
 * @Destribution 工作流审批用户组
 * @author houzx
 * @date 2020年10月27日
 */
@Entity
@Table(name="WF_GROUP")
public class WfGroup extends BaseEntity {

    private static final long serialVersionUID = -1357202646943737728L;
    
    /**
     * 主键
     */
    @Id
    @Column(name="ID",nullable=false)
    @JsonSerialize(using = LongJsonSerializer.class)
    @JsonDeserialize(using = LongJsonDeserializer.class)
    private Long id = null;
    
    /**
     * 分组名称
     */
    @Column(name="NAME",nullable=false)
    @NotEmpty(message = "分组名称不能为空")
    @Length(max=50, message = "分组名称最大支持50个字符")
    private String name = "";
    
    /**
     * 分组编号(自动生成）
     */
    @Column(name="CODE",nullable=false)
    private String code = "";
    
    /**
     * 分组状态{T：启用}
     */
    @Column(name="STATUS",nullable=false)
    private String status = "";
    
    /**
     * 分组描述
     */
    @Column(name="CONTENT")
    @Length(max=200, message = "分组名称最大支持200个字符")
    private String content = "";
    
    /**
     * 组内人数
     */
    @Column(name = "PERSON")
    private Integer person = 0;
    
    /**
     * 创建人ID
     */
    @Column(name="CREATE_UID",nullable=false)
    private String createUid = "";
    
    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name="CREATE_TIME",nullable = false)
    private Date createTime = null;
    
    /**
     * 修改时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name="MODIFY_TIME",nullable = false)
    private Date modifyTime = null;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getPerson() {
        return person;
    }

    public void setPerson(Integer person) {
        this.person = person;
    }

    public String getCreateUid() {
        return createUid;
    }

    public void setCreateUid(String createUid) {
        this.createUid = createUid;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

}
